package com.rightsidetech.mall.dto.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;

@Data
public class BaseInfoUpReq implements Serializable {

    private Long id;

    @ApiModelProperty(value = "商品名称",required = true)
    @NotBlank(message = "商品名称不允许为空")
    @Pattern(regexp = "[\\u4e00-\\u9fa5a-zA-Z0-9-./()【】]{0,100}+",message = "商品名称不允许特殊字符长度最大为100")
    private String commodityName;

    @ApiModelProperty(value = "商品分类id",required = true)
    @NotNull(message = "分类id不允许为空")
    @Min(value = 0,message = "分类id不允许为负数")
    private Long typeId;

    @ApiModelProperty(value = "品牌分类id",required = true)
    @NotNull(message = "品牌id不允许为空")
    @Min(value = 0,message = "品牌id不允许为负数")
    private Long brandId;

    @ApiModelProperty("商品规格")
    private List<CommoditySpecsReq> specsList;

    @ApiModelProperty("规格明细")
    private List<DetailSpecsReq> detailSpecsList;
}
